<template>
    <el-select v-model="value" placeholder="请选择类型" :disabled="disabled" clearable style="width: 100%;" @change="handleChange">
        <el-option :value="1" label="库存"></el-option>
        <el-option :value="2" label="资产"></el-option>
        <el-option :value="3" label="费用"></el-option>
    </el-select>
</template>
<script>
export default {
    data() {
        return {
            value: null
        }
    },
    model: {
        prop: "type",
        event: "innerChange",
    },
    methods: {
        handleChange(value) {
            this.$emit("innerChange", value);
            this.$emit("change", value);
        }
    },
    watch: {
        type: {
            handler(value) {
                this.value = value;
            },
            immediate: true
        }
    },
    props: {
        disabled: {
            type: Boolean,
            default: false
        },
        type: {
            type: Number,
            default: null
        }
    }
}
</script>
<style lang="css" scoped></style>